/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.*;

/**
 * <p>Project: app2022 - Ex5
 * <p>Powered by webrx On 2022-01-18 15:47:07
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex5 {
    public static void main(String[] args) {
        //File是目录对象
        //File f = new File(System.getProperty("user.dir"));

        //File要求是文件对象
        File f = new File("C:\\app2022\\08io\\src\\main\\java\\cn\\webrx\\Ex5.java");
        BufferedReader br = null;
        try {
            br = new BufferedReader(new FileReader(f));
            int sum = 0;
            int zeroline = 0;
            while (br.ready()) {
                String s = br.readLine();
                sum++;
                if (s.trim().length() == 0) {
                    zeroline++;
                }
            }
            System.out.println(sum);
            System.out.println(zeroline);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
